<?php

$location = $_GET["p"];
if ( $location == NULL)
	$location = 1;
	
$sub = $_GET["s"];
if ( $sub == NULL)
	$sub = 1;
	
$sub2 = $_GET["a"];
if ( $sub2 == NULL)
	$sub2 = 1;

function tab_select($loc) 
{
global $location;
if ($location == $loc)
	return "selected";
else
	return "";
}

function sub_tab_select($loc) 
{
global $sub;
if ($sub == $loc)
	return "selected";
else
	return "";
}

function sub2_tab_select($loc,$loc2) 
{
global $sub2;
global $sub;
if ( $sub2 == NULL)
		$sub2 = 0;
if (($sub2 == $loc2) && ($sub == $loc))
	return "selected";
else
	return "";
}

function titulador() 
{
global $location;

	include 'conexion.php';

	$sql = "
	SELECT nombre_largo
	FROM dbo.modulo
 	WHERE id='$location'";
		$r_mod = sqlsrv_query($link,$sql) or die('Consulta fallida: ' .print_r( sqlsrv_errors(), true));
		$ren_mod = sqlsrv_fetch_array($r_mod);
		return $ren_mod[0];
}
?>